package com.peanut.bosskg.service.other.pay;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.pay.BatchOrderTransDTO;
import com.peanut.bosskg.entity.pay.BatchPaymentResDTO;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/***
 *
 *
 * 描    述：批量付款接口
 *
 * 创 建 者：@author lg
 * 创建时间：2021/7/22下午4:35
 * 创建描述：
 *
 */
@Service
@Slf4j
public class BatchPaymentService extends BaseService {


    /**
     * @param funCodeEnum
     * @param batchOrderTransDTO
     * @return
     * @throws Exception
     */
    public BatchPaymentResDTO doBusiness(FunCodeEnum funCodeEnum, BatchOrderTransDTO batchOrderTransDTO) throws Exception {
        log.info("批量付款接口开始:{}，{}", funCodeEnum, batchOrderTransDTO);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, batchOrderTransDTO);
        BatchPaymentResDTO batchPaymentResDTO = JSON.parseObject(responseMessage.getResData(), BatchPaymentResDTO.class);
        log.info("批量付款接口结束:{}", batchPaymentResDTO);
        return batchPaymentResDTO;
    }

}
